function varargout = rt_calb_def(varargin)
% RT_CALB_DEF M-file for rt_calb_def.fig
%      RT_CALB_DEF, by itself, creates a new RT_CALB_DEF or raises the existing
%      singleton*.
%
%      H = RT_CALB_DEF returns the handle to a new RT_CALB_DEF or the handle to
%      the existing singleton*.
%
%      RT_CALB_DEF('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in RT_CALB_DEF.M with the given input arguments.
%
%      RT_CALB_DEF('Property','Value',...) creates a new RT_CALB_DEF or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before rt_calb_def_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to rt_calb_def_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help rt_calb_def

% Last Modified by GUIDE v2.5 07-Jun-2010 17:15:35

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @rt_calb_def_OpeningFcn, ...
                   'gui_OutputFcn',  @rt_calb_def_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before rt_calb_def is made visible.
function rt_calb_def_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to rt_calb_def (see VARARGIN)

% Choose default command line output for rt_calb_def
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes rt_calb_def wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = rt_calb_def_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on selection change in rb_moorings.
function rb_moorings_Callback(hObject, eventdata, handles)
% hObject    handle to rb_moorings (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

set(handles.rb_ferries,'Value',0)
set(handles.popup_sites,'String',{'--- not set ---','MUK01','MAN01','SQX01'},'Value',1)
set(handles.popup_aux,'String',{'--- not set ---','Aux0','Aux1','Aux2','Aux3'},'Value',1)


% --- Executes on button press in rb_ferries.
function rb_ferries_Callback(hObject, eventdata, handles)
% hObject    handle to rb_ferries (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

set(handles.rb_moorings,'Value',0)
set(handles.popup_sites,'String',{'--- not set ---','VCF04'},'Value',1)
set(handles.popup_aux,'String',{'--- not set ---','Aux0','Aux1','Aux2'},'Value',1)


% --- Executes on selection change in popup_sites.
function popup_sites_Callback(hObject, eventdata, handles)
% hObject    handle to popup_sites (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popup_sites contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popup_sites


% --- Executes during object creation, after setting all properties.
function popup_sites_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popup_sites (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in popup_aux.
function popup_aux_Callback(hObject, eventdata, handles)
% hObject    handle to popup_aux (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popup_aux contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popup_aux


% --- Executes during object creation, after setting all properties.
function popup_aux_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popup_aux (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in popup_sensor.
function popup_sensor_Callback(hObject, eventdata, handles)
% hObject    handle to popup_sensor (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popup_sensor contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popup_sensor


% --- Executes during object creation, after setting all properties.
function popup_sensor_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popup_sensor (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in popup_measurement.
function popup_measurement_Callback(hObject, eventdata, handles)
% hObject    handle to popup_measurement (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popup_measurement contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popup_measurement


% --- Executes during object creation, after setting all properties.
function popup_measurement_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popup_measurement (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in pb_load_sbe43cal.
function pb_load_sbe43cal_Callback(hObject, eventdata, handles)
% hObject    handle to pb_load_sbe43cal (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

calidx = 2;
[filename, pathname] = uigetfile('*.XML', 'Pick a SBE43 (DO sensor) configuration file...');
sbe43cal = xml_read([pathname filename]);
rb_moorings_Callback(hObject, eventdata, handles)
set(handles.rb_moorings,'Value',1);
set(handles.popup_sensor,'Value',1)
sensors = get(handles.popup_sensor,'String');
for i = 1:length(sensors)
    if (findstr(sensors{i},'SBE43')>0 & findstr(sensors{i},num2str(sbe43cal.SerialNumber))>0)
        set(handles.popup_sensor,'Value',i)
    end
end
set(handles.popup_aux,'Value',2)
set(handles.popup_measurement,'Value',2)
set(handles.txt_deploy_date,'String','--- not set ---')
set(handles.txt_calb_date,'String',datestr(sbe43cal.CalibrationDate(1:9),'dd-mmm-yyyy HH:MM'))
set(handles.edit_c1,'String',num2str(sbe43cal.CalibrationCoefficients(calidx).Soc));
set(handles.edit_c2,'String',num2str(sbe43cal.CalibrationCoefficients(calidx).offset));
set(handles.edit_c3,'String',num2str(sbe43cal.CalibrationCoefficients(calidx).A));
set(handles.edit_c4,'String',num2str(sbe43cal.CalibrationCoefficients(calidx).B));
set(handles.edit_c5,'String',num2str(sbe43cal.CalibrationCoefficients(calidx).C));
set(handles.edit_c6,'String',num2str(sbe43cal.CalibrationCoefficients(calidx).D0));
set(handles.edit_c7,'String',num2str(sbe43cal.CalibrationCoefficients(calidx).D1));
set(handles.edit_c8,'String',num2str(sbe43cal.CalibrationCoefficients(calidx).D2));
set(handles.edit_c9,'String',num2str(sbe43cal.CalibrationCoefficients(calidx).E));
set(handles.edit_c10,'String',num2str(sbe43cal.CalibrationCoefficients(calidx).Tau20));
set(handles.edit_c11,'String',num2str(sbe43cal.CalibrationCoefficients(calidx).H1));
set(handles.edit_c12,'String',num2str(sbe43cal.CalibrationCoefficients(calidx).H2));
set(handles.edit_c13,'String',num2str(sbe43cal.CalibrationCoefficients(calidx).H3));


% --- Executes on button press in pb_deploy_date.
function pb_deploy_date_Callback(hObject, eventdata, handles)
% hObject    handle to pb_deploy_date (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

set(handles.txt_deploy_date,'String',datestr(uigetdate,'dd-mmm-yyyy HH:MM'))


% --- Executes on button press in pb_calb_date.
function pb_calb_date_Callback(hObject, eventdata, handles)
% hObject    handle to pb_calb_date (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

set(handles.txt_calb_date,'String',datestr(uigetdate,'dd-mmm-yyyy HH:MM'))


% --- Executes on button press in pb_updatedb.
function pb_updatedb_Callback(hObject, eventdata, handles)
% hObject    handle to pb_updatedb (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

try
    db_colnames     = {'SiteID','AuxID','UTC_Deploy','Manufacturer','Model','SerialNum','MeasurementType','UTC_Calb',...
                       'C1','C2','C3','C4','C5','C6','C7','C8','C9','C10','C11','C12','C13'};
    site_str        = get(handles.popup_sites,'String');
    site_str        = char(site_str(get(handles.popup_sites,'Value')));
    aux_str         = get(handles.popup_aux,'String');
    aux_str         = char(aux_str(get(handles.popup_aux,'Value')));
    aux_num         = str2num(aux_str(end));
    sensor_str      = get(handles.popup_sensor,'String');
    sensor_str      = char(sensor_str(get(handles.popup_sensor,'Value')));
    measurement_str = get(handles.popup_measurement,'String');
    measurement_str = char(measurement_str(get(handles.popup_measurement,'Value')));
    mfg_str         = sensor_str(1:findstr(sensor_str,',')-1);
    model_str       = sensor_str(findstr(sensor_str,',')+2:findstr(sensor_str,'(')-1);
    serial_num      = str2num(sensor_str(findstr(sensor_str,':')+2:findstr(sensor_str,')')-1));
    db_dat_insert   = {site_str,...
                       aux_num,...
                       datenum(get(handles.txt_deploy_date,'String')),...
                       mfg_str,...
                       model_str,...
                       serial_num,...
                       measurement_str,...
                       datenum(get(handles.txt_calb_date,'String')),...
                       str2num(get(handles.edit_c1,'String')),...
                       str2num(get(handles.edit_c2,'String')),...
                       str2num(get(handles.edit_c3,'String')),...
                       str2num(get(handles.edit_c4,'String')),...
                       str2num(get(handles.edit_c5,'String')),...
                       str2num(get(handles.edit_c6,'String')),...
                       str2num(get(handles.edit_c7,'String')),...
                       str2num(get(handles.edit_c8,'String')),...
                       str2num(get(handles.edit_c9,'String')),...
                       str2num(get(handles.edit_c10,'String')),...
                       str2num(get(handles.edit_c11,'String')),...
                       str2num(get(handles.edit_c12,'String')),...
                       str2num(get(handles.edit_c13,'String'))};

    conn = database('MMU_RealtimeData', '', '');
    if get(handles.rb_moorings,'Value')
        fastinsert(conn,'Mooring_Calb',db_colnames,db_dat_insert);
    elseif get(handles.rb_ferries,'Value')
        fastinsert(conn,'VictoriaClipper_Calb',db_colnames(1:10),db_dat_insert(1:10));
    end
    close(conn)
    h = msgbox('Database Updated...','Success');
catch ME
    h = errordlg('Error Updating Database...','Error');
end


% --- Executes on button press in pb_reset.
function pb_reset_Callback(hObject, eventdata, handles)
% hObject    handle to pb_reset (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

rb_moorings_Callback(hObject, eventdata, handles)
set(handles.rb_moorings,'Value',1);
set(handles.popup_sites,'Value',1);
set(handles.popup_aux,'Value',1);
set(handles.popup_sensor,'Value',1);
set(handles.popup_measurement,'Value',1);
set(handles.txt_deploy_date,'String','--- not set ---');
set(handles.txt_calb_date,'String','--- not set ---');
set(handles.edit_c1,'String','');
set(handles.edit_c2,'String','');
set(handles.edit_c3,'String','');
set(handles.edit_c4,'String','');
set(handles.edit_c5,'String','');
set(handles.edit_c6,'String','');
set(handles.edit_c7,'String','');
set(handles.edit_c8,'String','');
set(handles.edit_c9,'String','');
set(handles.edit_c10,'String','');
set(handles.edit_c11,'String','');
set(handles.edit_c12,'String','');
set(handles.edit_c13,'String','');
set(handles.edit_c13,'String','');


function edit_c1_Callback(hObject, eventdata, handles)
% hObject    handle to edit_c1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_c1 as text
%        str2double(get(hObject,'String')) returns contents of edit_c1 as a double


% --- Executes during object creation, after setting all properties.
function edit_c1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_c1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_c2_Callback(hObject, eventdata, handles)
% hObject    handle to edit_c2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_c2 as text
%        str2double(get(hObject,'String')) returns contents of edit_c2 as a double


% --- Executes during object creation, after setting all properties.
function edit_c2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_c2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_c3_Callback(hObject, eventdata, handles)
% hObject    handle to edit_c3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_c3 as text
%        str2double(get(hObject,'String')) returns contents of edit_c3 as a double


% --- Executes during object creation, after setting all properties.
function edit_c3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_c3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_c4_Callback(hObject, eventdata, handles)
% hObject    handle to edit_c4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_c4 as text
%        str2double(get(hObject,'String')) returns contents of edit_c4 as a double


% --- Executes during object creation, after setting all properties.
function edit_c4_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_c4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_c5_Callback(hObject, eventdata, handles)
% hObject    handle to edit_c5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_c5 as text
%        str2double(get(hObject,'String')) returns contents of edit_c5 as a double


% --- Executes during object creation, after setting all properties.
function edit_c5_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_c5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_c6_Callback(hObject, eventdata, handles)
% hObject    handle to edit_c6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_c6 as text
%        str2double(get(hObject,'String')) returns contents of edit_c6 as a double


% --- Executes during object creation, after setting all properties.
function edit_c6_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_c6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_c7_Callback(hObject, eventdata, handles)
% hObject    handle to edit_c7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_c7 as text
%        str2double(get(hObject,'String')) returns contents of edit_c7 as a double


% --- Executes during object creation, after setting all properties.
function edit_c7_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_c7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_c8_Callback(hObject, eventdata, handles)
% hObject    handle to edit_c8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_c8 as text
%        str2double(get(hObject,'String')) returns contents of edit_c8 as a double


% --- Executes during object creation, after setting all properties.
function edit_c8_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_c8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_c9_Callback(hObject, eventdata, handles)
% hObject    handle to edit_c9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_c9 as text
%        str2double(get(hObject,'String')) returns contents of edit_c9 as a double


% --- Executes during object creation, after setting all properties.
function edit_c9_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_c9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_c10_Callback(hObject, eventdata, handles)
% hObject    handle to edit_c10 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_c10 as text
%        str2double(get(hObject,'String')) returns contents of edit_c10 as a double


% --- Executes during object creation, after setting all properties.
function edit_c10_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_c10 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_c11_Callback(hObject, eventdata, handles)
% hObject    handle to edit_c11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_c11 as text
%        str2double(get(hObject,'String')) returns contents of edit_c11 as a double


% --- Executes during object creation, after setting all properties.
function edit_c11_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_c11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_c12_Callback(hObject, eventdata, handles)
% hObject    handle to edit_c12 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_c12 as text
%        str2double(get(hObject,'String')) returns contents of edit_c12 as a double


% --- Executes during object creation, after setting all properties.
function edit_c12_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_c12 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_c13_Callback(hObject, eventdata, handles)
% hObject    handle to edit_c13 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit_c13 as text
%        str2double(get(hObject,'String')) returns contents of edit_c13 as a double


% --- Executes during object creation, after setting all properties.
function edit_c13_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_c13 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end